home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Folders.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  11.5 KB  |  348 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Folders.a
  3. ;
  4. ;    Contains:    Folder Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__FOLDERS__') = 'UNDEFINED' THEN
  19. __FOLDERS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.  
  25.  
  26. kOnSystemDisk                    EQU        $8000
  27.  
  28. kCreateFolder                    EQU        1
  29. kDontCreateFolder                EQU        0
  30.  
  31. kSystemFolderType                EQU        'macs'                ; the system folder 
  32. kDesktopFolderType                EQU        'desk'                ; the desktop folder; objects in this folder show on the desk top. 
  33. kTrashFolderType                EQU        'trsh'                ; the trash folder; objects in this folder show up in the trash 
  34. kWhereToEmptyTrashFolderType    EQU        'empt'                ; the "empty trash" folder; Finder starts empty from here down 
  35. kPrintMonitorDocsFolderType        EQU        'prnt'                ; Print Monitor documents 
  36. kStartupFolderType                EQU        'strt'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here 
  37. kShutdownFolderType                EQU        'shdf'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here 
  38. kAppleMenuFolderType            EQU        'amnu'                ; Finder objects to put into the Apple menu go here 
  39. kControlPanelFolderType            EQU        'ctrl'                ; Control Panels go here (may contain INITs) 
  40. kExtensionFolderType            EQU        'extn'                ; Finder extensions go here 
  41. kFontsFolderType                EQU        'font'                ; Fonts go here 
  42. kPreferencesFolderType            EQU        'pref'                ; preferences for applications go here 
  43. kTemporaryFolderType            EQU        'temp'                ; temporary files go here (deleted periodically, but don't rely on it.) 
  44. ;    Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  45. ;            while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  46. ;            Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  47. ;
  48.  
  49.     IF &TYPE('USE_FINDFOLDER_GLUE') <> 'UNDEFINED' THEN
  50. ;
  51. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  52. ;
  53.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  54.         IMPORT_CFM_FUNCTION FindFolder
  55.     ENDIF
  56.  
  57.     ELSE
  58. ;
  59. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  60. ;
  61.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  62.         Macro
  63.         _FindFolder
  64.             moveq               #0,D0
  65.             dc.w                $A823
  66.         EndM
  67.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  68.         IMPORT_CFM_FUNCTION FindFolder
  69.     ENDIF
  70.  
  71.     ENDIF
  72. ;
  73. ; pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
  74. ;
  75.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  76.         Macro
  77.         _ReleaseFolder
  78.             moveq               #11,D0
  79.             dc.w                $A823
  80.         EndM
  81.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  82.         IMPORT_CFM_FUNCTION ReleaseFolder
  83.     ENDIF
  84.  
  85.  
  86. ; *****************************************
  87. ;  Extensible Folder Manager declarations 
  88. ; *****************************************
  89.  
  90. ; ***************************
  91. ;  Folder Manager constants 
  92. ; ***************************
  93.  
  94. ;  new Folder Manager error codes 
  95.  
  96. badFolderDescErr                EQU        -4270
  97. duplicateFolderDescErr            EQU        -4271
  98. noMoreFolderDescErr                EQU        -4272
  99. invalidFolderTypeErr            EQU        -4273
  100. duplicateRoutingErr                EQU        -4274
  101. routingNotFoundErr                EQU        -4275
  102. badRoutingSizeErr                EQU        -4276
  103.  
  104.  
  105. kExtensionDisabledFolderType    EQU        'extD'
  106. kControlPanelDisabledFolderType    EQU        'ctrD'
  107. kSystemExtensionDisabledFolderType EQU    'macD'
  108. kStartupItemsDisabledFolderType    EQU        'strD'
  109. kShutdownItemsDisabledFolderType EQU    'shdD'
  110. kApplicationsFolderType            EQU        'apps'
  111. kDocumentsFolderType            EQU        'docs'
  112.  
  113.                                                             ; new constants 
  114. kVolumeRootFolderType            EQU        'root'                ; root folder of a volume 
  115. kChewableItemsFolderType        EQU        'flnt'                ; items deleted at boot 
  116. kApplicationSupportFolderType    EQU        'asup'                ; third-party items and folders 
  117. kTextEncodingsFolderType        EQU        'ƒtex'                ; encoding tables 
  118. kStationeryFolderType            EQU        'odst'                ; stationery 
  119. kOpenDocFolderType                EQU        'odod'                ; OpenDoc root 
  120. kOpenDocShellPlugInsFolderType    EQU        'odsp'                ; OpenDoc Shell Plug-Ins in OpenDoc folder 
  121. kEditorsFolderType                EQU        'oded'                ; OpenDoc editors in MacOS Folder 
  122. kOpenDocEditorsFolderType        EQU        'ƒodf'                ; OpenDoc subfolder of Editors folder 
  123. kOpenDocLibrariesFolderType        EQU        'odlb'                ; OpenDoc libraries folder 
  124. kGenEditorsFolderType            EQU        'ƒedi'                ; CKH general editors folder at root level of Sys folder 
  125. kHelpFolderType                    EQU        'ƒhlp'                ; CKH help folder currently at root of system folder 
  126. kInternetPlugInFolderType        EQU        'ƒnet'                ; CKH internet plug ins for browsers and stuff 
  127. kModemScriptsFolderType            EQU        'ƒmod'                ; CKH modem scripts, get 'em OUT of the Extensions folder 
  128. kPrinterDescriptionFolderType    EQU        'ppdf'                ; CKH new folder at root of System folder for printer descs. 
  129. kPrinterDriverFolderType        EQU        'ƒprd'                ; CKH new folder at root of System folder for printer drivers 
  130. kScriptingAdditionsFolderType    EQU        'ƒscr'                ; CKH at root of system folder 
  131. kSharedLibrariesFolderType        EQU        'ƒlib'                ; CKH for general shared libs. 
  132. kVoicesFolderType                EQU        'fvoc'                ; CKH macintalk can live here 
  133. kControlStripModulesFolderType    EQU        'sdev'                ; CKH for control strip modules 
  134. kAssistantsFolderType            EQU        'astƒ'                ; SJF for Assistants (MacOS Setup Assistant, etc) 
  135. kUtilitiesFolderType            EQU        'utiƒ'                ; SJF for Utilities folder 
  136. kAppleExtrasFolderType            EQU        'aexƒ'                ; SJF for Apple Extras folder 
  137. kContextualMenuItemsFolderType    EQU        'cmnu'                ; SJF for Contextual Menu items 
  138. kMacOSReadMesFolderType            EQU        'morƒ'                ; SJF for MacOS ReadMes folder 
  139. kALMModulesFolderType            EQU        'walk'                ; EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) 
  140. kALMPreferencesFolderType        EQU        'trip'                ; EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) 
  141. kALMLocationsFolderType            EQU        'fall'                ; EAS for Location Manager Locations (within kALMPreferencesFolderType) 
  142.  
  143. ;  FolderDescFlags values 
  144.  
  145. kCreateFolderAtBoot                EQU        $00000002
  146. kFolderCreatedInvisible            EQU        $00000004
  147. kFolderCreatedNameLocked        EQU        $00000008
  148. ; typedef UInt32                         FolderDescFlags
  149.  
  150. ;  FolderClass values 
  151.  
  152. kRelativeFolder                    EQU        'relf'
  153. kSpecialFolder                    EQU        'spcf'
  154. ; typedef OSType                         FolderClass
  155.  
  156. ;  special folder locations 
  157.  
  158. kBlessedFolder                    EQU        'blsf'
  159. kRootFolder                        EQU        'rotf'
  160. ; typedef OSType                         FolderType
  161.  
  162. ; typedef OSType                         FolderLocation
  163.  
  164.  
  165. FolderDesc                RECORD 0
  166. descSize                 ds.l    1                ; offset: $0 (0)
  167. foldType                 ds.l    1                ; offset: $4 (4)
  168. flags                     ds.l    1                ; offset: $8 (8)
  169. foldClass                 ds.l    1                ; offset: $C (12)
  170. foldLocation             ds.l    1                ; offset: $10 (16)
  171. badgeSignature             ds.l    1                ; offset: $14 (20)
  172. badgeType                 ds.l    1                ; offset: $18 (24)
  173. reserved                 ds.l    1                ; offset: $1C (28)
  174. name                     ds        Str63            ; offset: $20 (32)
  175. sizeof                     EQU *                    ; size:   $60 (96)
  176.                         ENDR
  177. ; typedef struct FolderDesc *            FolderDescPtr
  178.  
  179.  
  180. ; typedef UInt32                         RoutingFlags
  181.  
  182. FolderRouting            RECORD 0
  183. descSize                 ds.l    1                ; offset: $0 (0)
  184. fileType                 ds.l    1                ; offset: $4 (4)
  185. routeFromFolder             ds.l    1                ; offset: $8 (8)
  186. routeToFolder             ds.l    1                ; offset: $C (12)
  187. flags                     ds.l    1                ; offset: $10 (16)
  188. sizeof                     EQU *                    ; size:   $14 (20)
  189.                         ENDR
  190. ; typedef struct FolderRouting *        FolderRoutingPtr
  191.  
  192. ;  routing constants 
  193. ; **************************
  194. ;  Folder Manager routines 
  195. ; **************************
  196. ;  Folder Manager administration routines 
  197. ;
  198. ; pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, ConstStr63Param name, Boolean replaceFlag)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  201.         Macro
  202.         _AddFolderDescriptor
  203.             moveq               #32,D0
  204.             dc.w                $A823
  205.         EndM
  206.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  207.         IMPORT_CFM_FUNCTION AddFolderDescriptor
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc)
  212. ;
  213.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  214.         Macro
  215.         _GetFolderDescriptor
  216.             moveq               #35,D0
  217.             dc.w                $A823
  218.         EndM
  219.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION GetFolderDescriptor
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes)
  225. ;
  226.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  227.         Macro
  228.         _GetFolderTypes
  229.             moveq               #36,D0
  230.             dc.w                $A823
  231.         EndM
  232.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION GetFolderTypes
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal OSErr RemoveFolderDescriptor(FolderType foldType)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  240.         Macro
  241.         _RemoveFolderDescriptor
  242.             moveq               #33,D0
  243.             dc.w                $A823
  244.         EndM
  245.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION RemoveFolderDescriptor
  247.     ENDIF
  248.  
  249. ;  legacy routines 
  250. ;
  251. ; pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, Str63 name)
  252. ;
  253.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  254.         Macro
  255.         _GetFolderName
  256.             moveq               #14,D0
  257.             dc.w                $A823
  258.         EndM
  259.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  260.         IMPORT_CFM_FUNCTION GetFolderName
  261.     ENDIF
  262.  
  263. ;  routing routines 
  264. ;
  265. ; pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag)
  266. ;
  267.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  268.         Macro
  269.         _AddFolderRouting
  270.             moveq               #38,D0
  271.             dc.w                $A823
  272.         EndM
  273.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION AddFolderRouting
  275.     ENDIF
  276.  
  277. ;
  278. ; pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  281.         Macro
  282.         _RemoveFolderRouting
  283.             moveq               #39,D0
  284.             dc.w                $A823
  285.         EndM
  286.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  287.         IMPORT_CFM_FUNCTION RemoveFolderRouting
  288.     ENDIF
  289.  
  290. ;
  291. ; pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags)
  292. ;
  293.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  294.         Macro
  295.         _FindFolderRouting
  296.             moveq               #34,D0
  297.             dc.w                $A823
  298.         EndM
  299.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  300.         IMPORT_CFM_FUNCTION FindFolderRouting
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings)
  305. ;
  306.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  307.         Macro
  308.         _GetFolderRoutings
  309.             moveq               #30,D0
  310.             dc.w                $A823
  311.         EndM
  312.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  313.         IMPORT_CFM_FUNCTION GetFolderRoutings
  314.     ENDIF
  315.  
  316. ;
  317. ; pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID)
  318. ;
  319.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  320.         Macro
  321.         _InvalidateFolderDescriptorCache
  322.             moveq               #37,D0
  323.             dc.w                $A823
  324.         EndM
  325.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION InvalidateFolderDescriptorCache
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal OSErr IdentifyFolder(short vRefNum, long dirID, FolderType *foldType)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  333.         Macro
  334.         _IdentifyFolder
  335.             moveq               #31,D0
  336.             dc.w                $A823
  337.         EndM
  338.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION IdentifyFolder
  340.     ENDIF
  341.  
  342.  
  343.  
  344.  
  345.     ENDIF ; __FOLDERS__ 
  346.  
  347.